from rest_framework.throttling import SimpleRateThrottle

class RateThrottle(SimpleRateThrottle):
    # 指定访问频率
    rate = '5/m'

    def get_cache_key(self, request, view):
        return self.get_ident(request)

